From 81a4406d6646b7dabc72454fdf5445d1a5188c05 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Tue, 24 May 2011 15:15:27 +0100 Subject: [PATCH] libxl: check that device model binary is executable. This causes us to fail more quickly in more obvious failure case of not having the right binary installed. Signed-off-by: Ian Campbell Acked-by: Ian Jackson Signed-off-by: Ian Jackson --- tools/libxl/libxl_dm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 47a51c8708..b31ce859e8 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -762,7 +762,12 @@ int libxl__create_device_model(libxl__gc *gc, rc = ERROR_FAIL; goto out; } - + if (access(dm, X_OK) < 0) { + LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, + "device model %s is not executable", dm); + rc = ERROR_FAIL; + goto out; + } args = libxl__build_device_model_args(gc, dm, info, disks, num_disks, vifs, num_vifs); if (!args) { -- 2.30.2